<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Start a new page</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="function.ps-arcn.html">« ps_arcn</a></li>
      <li style="float: right;"><a href="function.ps-begin-pattern.html">ps_begin_pattern »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="ref.ps.html">PS 函数</a></li>
    <li>Start a new page</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="function.ps-begin-page" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ps_begin_page</h1>
  <p class="verinfo">(PECL ps &gt;= 1.1.0)</p><p class="refpurpose"><span class="refname">ps_begin_page</span> &mdash; <span class="dc-title">Start a new page</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.ps-begin-page-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>ps_begin_page</strong></span>(<span class="methodparam"><span class="type">resource</span> <code class="parameter">$psdoc</code></span>, <span class="methodparam"><span class="type">float</span> <code class="parameter">$width</code></span>, <span class="methodparam"><span class="type">float</span> <code class="parameter">$height</code></span>): <span class="type">bool</span></div>

  <p class="para rdfs-comment">
   Starts a new page. Although the parameters <code class="parameter">width</code>
   and <code class="parameter">height</code> imply a different page size for each
   page, this is not possible in PostScript. The first call of
   <span class="function"><strong>ps_begin_page()</strong></span> will set the page size for the whole
   document. Consecutive calls will have no effect, except for creating a new
   page. The situation is different if you intent to convert the PostScript
   document into PDF. This function places pdfmarks into the document which
   can set the size for each page indiviually. The resulting PDF document will
   have different page sizes.
  </p>
  <p class="para">
   Though PostScript does not know different page sizes, pslib places
   a bounding box for each page into the document. This size is evaluated
   by some PostScript viewers and will have precedence over the BoundingBox
   in the Header of the document. This can lead to unexpected results when
   you set a BoundingBox whose lower left corner is not (0, 0), because the
   bounding box of the page will always have a lower left corner (0, 0)
   and overwrites the global setting.
  </p>
  <p class="para">
   Each page is encapsulated into save/restore. This means, that most of the
   settings made on one page will not be retained on the next page.
  </p>
  <p class="para">
   If there is up to the first call of <span class="function"><strong>ps_begin_page()</strong></span> no
   call of <span class="function"><a href="function.ps-findfont.html" class="function">ps_findfont()</a></span>, then the header of the PostScript
   document will be output and the bounding box will be set to the size of
   the first page. The lower left corner of the bounding box is set to (0, 0).
   If <span class="function"><a href="function.ps-findfont.html" class="function">ps_findfont()</a></span> was called before, then the
   header has been output already, and the document will not have a valid
   bounding box. In order to prevent this, one should call
   <span class="function"><a href="function.ps-set-info.html" class="function">ps_set_info()</a></span> to set the info field
   <code class="literal">BoundingBox</code> and possibly <code class="literal">Orientation</code>
   before any <span class="function"><a href="function.ps-findfont.html" class="function">ps_findfont()</a></span> or
   <span class="function"><strong>ps_begin_page()</strong></span> calls.
  </p>
  <blockquote class="note"><p><strong class="note">注意</strong>: 
   <p class="para">
    Up to version 0.2.6 of pslib, this function will always overwrite
    the BoundingBox and Orientation, if it has been set before with
    <span class="function"><a href="function.ps-set-info.html" class="function">ps_set_info()</a></span> and <span class="function"><a href="function.ps-findfont.html" class="function">ps_findfont()</a></span>
    has not been called before.
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.ps-begin-page-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
     <dt>
<code class="parameter">psdoc</code></dt>

     <dd>

      <p class="para">
       Resource identifier of the postscript file
       as returned by <span class="function"><a href="function.ps-new.html" class="function">ps_new()</a></span>.
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">width</code></dt>

     <dd>

      <p class="para">
       The width of the page in pixel, e.g. 596 for A4 format.
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">height</code></dt>

     <dd>

      <p class="para">
       The height of the page in pixel, e.g. 842 for A4 format.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.ps-begin-page-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   成功时返回 <strong><code>true</code></strong>， 或者在失败时返回 <strong><code>false</code></strong>。
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.ps-begin-page-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.ps-end-page.html" class="function" rel="rdfs-seeAlso">ps_end_page()</a> - End a page</span></li>
    <li class="member"><span class="function"><a href="function.ps-findfont.html" class="function" rel="rdfs-seeAlso">ps_findfont()</a> - Loads a font</span></li>
    <li class="member"><span class="function"><a href="function.ps-set-info.html" class="function" rel="rdfs-seeAlso">ps_set_info()</a> - Sets information fields of document</span></li>
   </ul>
  </p>
 </div>

</div></div></div></body></html>